//
//  ZDNavigationController.m
//  1012GiftTips
//
//  Created by Apple on 15/10/12.
//  Copyright © 2015年 itcast. All rights reserved.
//

#import "ZDNavigationController.h"

@interface ZDNavigationController ()

@end

@implementation ZDNavigationController

+ (void)load
{
    if (self == [ZDNavigationController class])
    {
        //获取全局导航条
        UINavigationBar *bar = [UINavigationBar appearance];
        
        //设置背景颜色
        bar.barTintColor = [UIColor redColor];
        
        //设置barItem的颜色
        bar.tintColor = [UIColor whiteColor];
        
        //设置文本属性
        [bar setTitleTextAttributes:@{NSFontAttributeName:ZDFont(18.0), NSForegroundColorAttributeName:[UIColor whiteColor]}];
        
//        NSArray *familyNames = [UIFont familyNames];
//        
//        for (NSString *familyName in familyNames)
//        {
//            printf("%s:\n", familyName.UTF8String);
//            
//            NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
//            
//            for (NSString *fontName in fontNames)
//            {
//                printf("\t%s\n", fontName.UTF8String);
//            }
//        }
    }
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    //拖拽的时候隐藏navigationBar  上下滚动的时候
    //When this property is set to YES, an upward swipe hides the navigation bar and toolbar. A downward swipe shows both bars again.
    self.hidesBarsOnSwipe = YES;
}


#pragma mark - 重写push方法，设置push操作时隐藏tabBar
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    //必须先设置再执行push操作
    viewController.hidesBottomBarWhenPushed = YES;
    
    [super pushViewController:viewController animated:animated];
}


@end
